<?php

use yii\widgets\ActiveForm;
use backend\models\TmeUnitinfo;
use backend\models\TmeMerchandiseinfo;

?>

<?php 

/*@var $form  yii\widgets\ActiveForm */
$form = ActiveForm::begin();

?>

	<div  style="font-size:14px;line-height:30px;height:39px">
		会员信息<br/>			
	</div>
	<div class='col-sm-6' >
		<?= $form->field($model,"member",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',
												'margin-left'=>'10px',
												'float'=>'left',
												'width'=>'50px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$member,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ?>
	</div>
	<div class='col-sm-6' >
	<?= $form->field($model,"mail",[
									'template'=>'{label}{input}',
									'labelOptions'=>[
										'style'=>[
											'text-align'=>'right',
											'margin-left'=>'10px',
											'float'=>'left',
											'width'=>'50px',
											'height'=>'34px',
											'line-height'=>'34px'
									]],										
	])->textInput(['readonly'=>'readonly','value'=>$mail,'class'=>'col-xs-10 col-sm-8','style'=>['margin-left'=>'10px',]]) ?>
	</div>
	<div class='col-sm-12' style="margin-top:0px;" >
		<div class="hr hr-12 hr-double"   ></div>
		<div  style="font-size:14px;line-height:30px;height:39px">
			收货信息<br/>			
		</div>
	</div>
	<div class='col-sm-6' >
		<?= $form->field($model,"recMan",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',
												'margin-left'=>'10px',
												'float'=>'left',
												'width'=>'50px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$recMan,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ?>
	</div>
	<div class='col-sm-6' >
		<?= $form->field($model,"post",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',
												'margin-left'=>'10px',
												'float'=>'left',
												'width'=>'50px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$post,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ?>
	</div>
	<div class='col-sm-6' style="margin-top:5px" >
		<?= $form->field($model,"tel",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',
												'float'=>'left',
												'width'=>'60px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$phone,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ?>
	</div>
	<div class='col-sm-6' style="margin-top:5px" >
		<?= $form->field($model,"address",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',												
												'float'=>'left',
												'width'=>'60px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$address,'class'=>'col-xs-10 col-sm-8','style'=>['margin-left'=>'10px']]) ?>
	</div>
	
	<div class='col-sm-12'  >
		<div class="hr hr-12 hr-double"  ></div>
		<div  style="font-size:14px;line-height:30px;height:39px">
			配送信息<br/>			
		</div>
	</div>
	<div class='col-sm-6' >
		<?= $form->field($model,"delivery",[
									'template'=>'{label}{input}',
									'labelOptions'=>[
										'style'=>[
											'text-align'=>'right',												
											'float'=>'left',
											'width'=>'60px',
											'height'=>'34px',
											'line-height'=>'34px'
									]],									
		 ])->textInput(['readonly'=>'readonly','value'=>$delivery,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]); ?>
	</div>	
	<div class='col-sm-6' >
		<?= $form->field($model,"state",[
										'template'=>'{label}{input}',
										'labelOptions'=>[
											'style'=>[
												'text-align'=>'right',											
												'float'=>'left',
												'width'=>'60px',
												'height'=>'34px',
												'line-height'=>'34px'
										]],										
		])->textInput(['readonly'=>'readonly','value'=>$states,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ?>
	</div>				
	<div class='col-sm-12' style="margin-top:0px;" >
		<div class="hr hr-12 hr-double"  ></div>
		<div  style="font-size:14px;line-height:30px;height:39px">
			商品信息<br/>			
		</div>
	</div>
	<?php 
	
		foreach ($orderInfo as $v ){
			
			$merchanid = $v['MerchandiseID'];  		   //商品编码
			$price = $v['Price'];      				   //商品价格
			$num = $v['Num'];         				   //商品数量
			$totalPrice = $price*$num;      		   //商品总价
			$unitId = $v['UnitID'];    				   //商品单位ID
			$unit = TmeUnitinfo::find()->where(['UnitID'=>$unitId])->asArray()->one();  //查询商品单位表
			$unitName =$unit['Name'];       				   //商品单位
			$merchan = TmeMerchandiseinfo::find()->where(['MerchandiseID'=>$merchanid])->asArray()->one();  //查询商品表
			$merchanName = $merchan['MerchandiseName'];
			
			
			echo "<div class='col-sm-6' >";
			echo  $form->field($model,"commodity",[
					'template'=>'{label}{input}',
					'labelOptions'=>[
					'style'=>[
					'text-align'=>'right',
					'float'=>'left',
					'width'=>'60px',
					'height'=>'34px',
					'line-height'=>'34px'
					]],
					])->textInput(['readonly'=>'readonly','value'=>$merchanName,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px']]); 
			echo '</div>';
				
			echo "<div class='col-sm-6'  >";
			echo "<div class='col-sm-3' style='margin-left:20px;' >";	
			echo $form->field($model,"num",[
											'template'=>'{label}{input}',
											'labelOptions'=>[
												'style'=>[
													'text-align'=>'right',												
													//'float'=>'left',												
													'width'=>'30px',
													'height'=>'34px',
													'line-height'=>'34px'
											]],	
					 ])->textInput(['readonly'=>'readonly','value'=>$num,'style'=>['margin-top'=>'-40px','margin-left'=>'40px','width'=>'35px']]) ; 
			echo "</div>";
			echo "<div class='col-sm-3' style='margin-left:15px;' >	";
			echo $form->field($model,"unit",[
											'template'=>'{label}{input}',
											'labelOptions'=>[
												'style'=>[
													'text-align'=>'right',																								
													//'float'=>'left',
													'width'=>'30px',
													'height'=>'34px',
													'line-height'=>'34px'
											]],
					])->textInput(['readonly'=>'readonly','value'=>$unitName,'style'=>['margin-top'=>'-40px','margin-left'=>'40px','width'=>'40px']]) ;  
			echo "</div>";
			echo "</div>";
			echo "<div class='col-sm-6' style='margin-top:0px' >";
			echo $form->field($model,"price",[
											'template'=>'{label}{input}',
											'labelOptions'=>[
												'style'=>[
													'text-align'=>'right',
													//'margin-left'=>'10px',
													'float'=>'left',
													'width'=>'60px',
													'height'=>'34px',
													'line-height'=>'34px'
											]],		
					])->textInput(['readonly'=>'readonly','value'=>$price,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px']]) ;
					
			echo "</div>";
								
			echo "<div class='col-sm-6' style='margin-top:0px' >";
			echo $form->field($model,"totalPrice",[
											'template'=>'{label}{input}',
											'labelOptions'=>[
												'style'=>[
													'text-align'=>'right',											
													'float'=>'left',
													'width'=>'60px',
													'height'=>'34px',
													'line-height'=>'34px'
											]],								
					])->textInput(['readonly'=>'readonly','value'=>$totalPrice,'class'=>'col-xs-10 col-sm-5','style'=>['margin-left'=>'10px',]]) ;
			echo "</div>"; 
			echo "<hr class='col-sm-11' />";			
		}
	
	?>
		
		
<?php ActiveForm::end() ?>



